#FROM centos:6.7
FROM who7708/centos6.7
MAINTAINER Chris

ENV HOME=/root

COPY *.bash ${HOME}/tmp/

# Add crontab file in the cron directory
ADD hello-cron /etc/cron.d/hello-cron

RUN set -eux; \
    mkdir -p ${HOME}/tmp/00; \
    mkdir -p ${HOME}/tmp/01; \
    chmod 0644 /etc/cron.d/hello-cron; \
    # Create the log file to be able to run tail
    touch /var/log/cron.log; \
    crontab /etc/cron.d/hello-cron

# Run the command on container startup
CMD cron && tail -f /var/log/cron.log
